package com.pro.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.pro.domain.Film;
import com.pro.domain.Record;
import com.pro.mapper.CinemaMapper;
import com.pro.mapper.FilmMapper;
import com.pro.mapper.RecordMapper;
import com.pro.mapper.TheaterRoomMapper;
import com.pro.service.RecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class RecordServiceImpl implements RecordService {

    @Autowired
    private RecordMapper recordMapper;

    @Override
    public List<Record> querySeatCondition(Long filmId, Long trId, Long cinemaId, String startTime, String endTime) {
        QueryWrapper<Record> queryWrapper = new QueryWrapper<Record>();
        queryWrapper.eq("film_id", filmId);
        queryWrapper.eq("tr_id", trId);
        queryWrapper.eq("start_time", startTime);
        queryWrapper.eq("end_time", endTime);

        return recordMapper.selectList(queryWrapper);
    }
}
